inherited fListCompra: TfListCompra
  Left = 503
  Top = 149
  Caption = 'Listagem de Compras'
  ClientHeight = 399
  ClientWidth = 563
  OldCreateOrder = True
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel1: TPanel
    Width = 563
    inherited SpeedButton1: TSpeedButton
      Caption = 'Lancar'
      OnClick = SpeedButton1Click
    end
    inherited SpeedButton2: TSpeedButton
      OnClick = SpeedButton2Click
    end
    inherited SpeedButton3: TSpeedButton
      OnClick = SpeedButton3Click
    end
    inherited SpeedButton4: TSpeedButton
      Left = 491
    end
  end
  inherited Panel2: TPanel
    Top = 346
    Width = 563
    Visible = False
    inherited edtLocalizar: TEdit
      Width = 488
    end
  end
  inherited DBGrid1: TRxDBGrid
    Width = 563
    Height = 280
    DataSource = DataSource1
    OnDrawColumnCell = DBGrid1DrawColumnCell
    Columns = <
      item
        Alignment = taCenter
        Expanded = False
        FieldName = 'NUM_NOTA'
        Title.Alignment = taCenter
        Title.Caption = 'Nota N'#176
        Width = 49
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'NOME'
        Title.Caption = 'Fornecedor'
        Width = 222
        Visible = True
      end
      item
        Alignment = taCenter
        Expanded = False
        FieldName = 'DATA_COMPRA'
        Title.Alignment = taCenter
        Title.Caption = 'Data da Compra'
        Width = 83
        Visible = True
      end
      item
        Alignment = taCenter
        Expanded = False
        FieldName = 'DATA_ENTRADA'
        Title.Alignment = taCenter
        Title.Caption = 'Data de Entrada'
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'VALOR_TOTAL'
        Title.Alignment = taRightJustify
        Title.Caption = 'Valor Total'
        Width = 88
        Visible = True
      end
      item
        Alignment = taCenter
        Expanded = False
        FieldName = 'SITUACAO'
        Title.Alignment = taCenter
        Title.Caption = 'Sit'
        Visible = False
      end>
  end
  object CompraConsulta: TIBOQuery
    Params = <>
    DatabaseName = 'C:\Delphi7\Integrado\Dados\BANCO.GDB'
    DeleteSQL.Strings = (
      'DELETE FROM COMPRA'
      'WHERE'
      '   CODIGO = :OLD_CODIGO')
    EditSQL.Strings = (
      'UPDATE COMPRA SET'
      '   CODIGO = :CODIGO, /*PK*/'
      '   NUM_NOTA = :NUM_NOTA,'
      '   FORNECEDOR_FK = :FORNECEDOR_FK,'
      '   CONDICAO_PGTO_FK = :CONDICAO_PGTO_FK,'
      '   DATA_COMPRA = :DATA_COMPRA,'
      '   DATA_ENTRADA = :DATA_ENTRADA,'
      '   VALOR_TOTAL = :VALOR_TOTAL,'
      '   SITUACAO = :SITUACAO,'
      '   ADIC_PERC = :ADIC_PERC,'
      '   ADIC_VAL = :ADIC_VAL,'
      '   DESC_PERC = :DESC_PERC,'
      '   DESC_VAL = :DESC_VAL,'
      '   SUB_TOTAL = :SUB_TOTAL'
      'WHERE'
      '   CODIGO = :OLD_CODIGO')
    IB_Connection = dm.base
    InsertSQL.Strings = (
      'INSERT INTO COMPRA('
      '   CODIGO, /*PK*/'
      '   NUM_NOTA,'
      '   FORNECEDOR_FK,'
      '   CONDICAO_PGTO_FK,'
      '   DATA_COMPRA,'
      '   DATA_ENTRADA,'
      '   VALOR_TOTAL,'
      '   SITUACAO,'
      '   ADIC_PERC,'
      '   ADIC_VAL,'
      '   DESC_PERC,'
      '   DESC_VAL,'
      '   SUB_TOTAL)'
      'VALUES ('
      '   :CODIGO,'
      '   :NUM_NOTA,'
      '   :FORNECEDOR_FK,'
      '   :CONDICAO_PGTO_FK,'
      '   :DATA_COMPRA,'
      '   :DATA_ENTRADA,'
      '   :VALOR_TOTAL,'
      '   :SITUACAO,'
      '   :ADIC_PERC,'
      '   :ADIC_VAL,'
      '   :DESC_PERC,'
      '   :DESC_VAL,'
      '   :SUB_TOTAL)')
    KeyLinks.Strings = (
      'compra.codigo')
    RecordCountAccurate = True
    SQL.Strings = (
      'select compra.*,pessoa.nome from compra'
      'inner join pessoa on pessoa.codigo = compra.fornecedor_fk'
      'where compra.codigo in ('
      'select distinct compra_itens.compra_fk from compra_itens)'
      'order by compra.codigo desc')
    FieldOptions = []
    Left = 312
    Top = 16
    object CompraConsultaCODIGO: TIntegerField
      FieldName = 'CODIGO'
      Required = True
    end
    object CompraConsultaNUM_NOTA: TIntegerField
      FieldName = 'NUM_NOTA'
    end
    object CompraConsultaFORNECEDOR_FK: TIntegerField
      FieldName = 'FORNECEDOR_FK'
    end
    object CompraConsultaCONDICAO_PGTO_FK: TIntegerField
      FieldName = 'CONDICAO_PGTO_FK'
    end
    object CompraConsultaDATA_COMPRA: TDateField
      FieldName = 'DATA_COMPRA'
    end
    object CompraConsultaDATA_ENTRADA: TDateField
      FieldName = 'DATA_ENTRADA'
    end
    object CompraConsultaVALOR_TOTAL: TBCDField
      FieldName = 'VALOR_TOTAL'
      DisplayFormat = '##,###,#0.00'
      Size = 2
    end
    object CompraConsultaSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 1
    end
    object CompraConsultaADIC_PERC: TBCDField
      FieldName = 'ADIC_PERC'
      Size = 2
    end
    object CompraConsultaADIC_VAL: TBCDField
      FieldName = 'ADIC_VAL'
      Size = 2
    end
    object CompraConsultaDESC_PERC: TBCDField
      FieldName = 'DESC_PERC'
      Size = 2
    end
    object CompraConsultaDESC_VAL: TBCDField
      FieldName = 'DESC_VAL'
      Size = 2
    end
    object CompraConsultaSUB_TOTAL: TBCDField
      FieldName = 'SUB_TOTAL'
      Size = 2
    end
    object CompraConsultaNOME: TStringField
      FieldName = 'NOME'
      Size = 100
    end
  end
  object DataSource1: TDataSource
    DataSet = CompraConsulta
    Left = 120
    Top = 184
  end
end
